/*
 *
 *  Copyright (C) 2012-2024
 *  All rights reserved, Designed By 杭州连线客信息技术有限公司
 *  注意：
 *  本软件为杭州连线客信息技术有限公司开发研制，未经购买不得使用
 *  购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 *  一经发现盗用、分享等行为，将追究法律责任，后果自负
 *
 */

package com.lxk.finance.enums;

import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * 账户模块枚举
 *
 * @author heyi
 * 2024/10/10
 */
public interface AccEnums {

    /**
     * 审核状态：0-待审核，1-通过审核，2-审核失败  100=用户撤回
     */
    @AllArgsConstructor
    @Getter
    enum AuditStatus {
        WAIT(0, "待审核"), YES(1, "通过审核"), FAIL(2, "审核失败"), ROLLBACK(100, "用户撤回");

        private static final Map<Integer, AuditStatus> map = CollUtil.toList(AuditStatus.values()).stream().collect(Collectors.toMap(AuditStatus::getCode, v -> v));
        private final Integer code;
        private final String name;

        public static Boolean containCode(Integer code) {
            return map.containsKey(code);
        }

        public static AuditStatus getByCode(Integer code) {
            return map.get(code);
        }
    }

    /**
     * 0-未到账，5=到账中  10-已到账
     */
    @AllArgsConstructor
    @Getter
    enum ArrivalStatus {
        NOT(0, "未到账"), ING(5, "到账中"), YES(10, "已到账");

        private static final Map<Integer, ArrivalStatus> map = CollUtil.toList(ArrivalStatus.values()).stream().collect(Collectors.toMap(ArrivalStatus::getCode, v -> v));
        private final Integer code;
        private final String name;

        public static Boolean containCode(Integer code) {
            return map.containsKey(code);
        }

        public static ArrivalStatus getByCode(Integer code) {
            return map.get(code);
        }
    }


    /**
     * 提现申请类型： WX=微信  ALI=支付宝
     */
    @AllArgsConstructor
    @Getter
    enum Type {
        WX("WX", "微信"),
        ALI("ALI", "支付宝"),
        BANK("BANK", "银行卡");

        private static final Map<String, Type> map = CollUtil.toList(Type.values()).stream().collect(Collectors.toMap(Type::getCode, v -> v));
        private final String code;
        private final String name;

        public static Boolean containCode(String code) {
            return map.containsKey(code);
        }

        public static Type getByCode(String code) {
            return map.get(code);
        }
    }

}
